import * as directoryApi from '@/api/hmmm/directorys'

const directory = {
  namespaced: true,
  state: {
    directoryList: {},
    catalogList: [],
    LabelList: []
  },
  mutations: {
    SET_DIRECTORY_LIST (state, newValue) {
      state.directoryList = newValue
    },
    SET_LABEL_LIST (state, newValue) {
      state.LabelList = newValue
    }
  },
  actions: {
    async updateDirectoryList ({ commit }, params) {
      const res = await directoryApi.list(params)
      commit('SET_DIRECTORY_LIST', res)
    },
    async updateLabelList ({ commit }, params) {
      const res = await directoryApi.simple(params)
      commit('SET_LABEL_LIST', res)
    }
  }
}
export default directory
